<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
      div{
        width: 200px;
        height: 200px;
        border: 1px solid red;
          /*超出部分隐藏*/
          overflow: hidden;
          /*超出部分滚动显示*/
          overflow: scroll;
      }
      img{
          /*设置上中下对齐*/
          vertical-align: bottom;
          vertical-align: middle;
          vertical-align: top;
          vertical-align: baseline;/*基线对齐 默认*/
      }

    </style>
</head>
<body>
<input type="text" /> <img src="../b.jpg" width="100" alt="">
  <div>
    <img src="../b.jpg" alt="">
  </div>
</body>
</html>